﻿<%@ Page Title="" Language="C#" MasterPageFile="~/administrator/backend.Master" AutoEventWireup="true" CodeBehind="schedule-add.aspx.cs" Inherits="VQWEB.administrator.english.schedule.schedule_add" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Content_backend" runat="server">
    <form id="frm_schedule" runat="server" role="form">
    <asp:FormView ID="frmSchedule" runat="server" RenderOuterTable="false">
        <EditItemTemplate>
            <div class="form-group">
                <label>
                    Title</label>
                <input class="form-control" name="schedule_title" type="text" value='<%# Eval("schedule_title") %>' />
            </div>            
            <div class="form-group">
                <label>
                    Content</label>
                <textarea class="form-control" name="schedule_content" rows="3"><%# Eval("schedule_content")%></textarea>
            </div>
            <div class="checkbox">
                <label>
                    <input <%# Eval("schedule_active") !=null && (bool)(Eval("schedule_active")) ? " checked='checked'" : null %>=""
                        name="schedule_active" type="checkbox" value="True" />
                    Active
                </label>
            </div>
            <input name="schedule_id" type="hidden" value='<%# (Eval("schedule_id") != null) ? Eval("schedule_id") : "0" %>' />
        </EditItemTemplate>
    </asp:FormView>
    </form>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Script_backend" runat="server">
    <script type="text/javascript">
        ShowToolBar("edit");
        var url_ashx = "/admin/english/schedule/handler";
        $("#btnCancel").live("click", function () {
            window.location = "/admin/englist/schedule/list";
        });
        $("#btnSave").live("click", function () {
            var arr = $("#frm_schedule").serializeObject();
            $.post(url_ashx, { add_schedule: window.escape(arr) }, function (data) {
                alert(data);
                window.location = "/admin/english/schedule/list";
            });
        });
    </script>
</asp:Content>
